{% include "header.html" %}
<div id="wrapper">
	<div id="simple-content-wrapper">
		<div id="content">
			<p><a href="/users/add/"><img src="../medias/images/adduser.PNG" width="100" height="20" border="0" alt=""></a></p>
					{% if is_paginated %}
                    {% ifequal current_page 1 %}
                    {% else %} <a href="?page=1"><img src="../medias/images/first.png" border="0" width="16" height="16" alt="转到第一页" /></a>
                    {% endifequal %}
                    {% if has_previous %} <a href="?page={{ previous }}"><img src="../medias/images/previous.png" border="0" width="16" height="16" alt="上一页" /></a>
                    {% else %} <img src="../medias/images/previous.png" width="16" height="16" border="0" alt="上一页" />
                    {% endif %}
                    {% for p in page_numbers %}
                        <a href="?page={{ p }}">{{ p }}</a>
                    {% endfor %}
                    {% if has_next %}<a href="?page={{ next }}"><img src="../medias/images/next.png" border="0" width="16" height="16" alt="下一页" /></a>
                    {% else %}<img src="../medias/images/next.png" border="0" width="16" height="16" alt="下一页" />
                    {% endif %}
                    {% ifequal current_page pages %}<img src="../medias/images/last.png" border="0" width="16" height="16" alt="转到最后一页" />
                    {% else %} <a href="?page={{ pages }}"><img src="../medias/images/last.png" border="0" width="16" height="16" alt="转到最后一页" /></a>
                    {% endifequal %}
                    &nbsp;&nbsp;
                    当前页：{{ page }}/{{ pages }}
                    &nbsp;&nbsp;
					{% endif %}              
					共[&nbsp;{{ hits }}&nbsp;]个用户
		{% load ad_tags %}
		{% flash %}
		 <h2>{{ params.type }}</h2>
		{{ msg }}
		{% endflash %}
		<form method="put" action="" name="usersform">
		<table cellspacing="0" border="0">
		<caption>用户列表</caption>
	<tr>
		<td><input type="button" value="Select All" onclick='selectAll("userid","button1")' name=button1></td>
		<td> 用户名</td>
		<td> 用户所属组 </td>
		<td> 用户状态 </td>
		<td> 用户类型 </td>
		<td> User Joined Date</td>
		<td> User Last Login Date </td>
		<td> &nbsp;</td>
	</tr>
	{% for x in object_list %}
	<tr class="{% cycle alt,'' %}">
		<td><input name="userid" type="checkbox" value="{{ x.id }}"/></td>
		<td> <a href="/users/{{ x.id }}/">{{ x.username }}</a>&nbsp;</td>
		<td>
			<ul class="nopadding">
				{% block group %}
					{% for g in x.groups.all %}
					<li class="nopadding">{{ g.name|title }}</li>
					{% endfor %}
				{% endblock %}
			</ul>&nbsp;
		</td>
		<td> {% if x.is_active %}
			<a href="/users/{{ x.id }}/chgstate/"><img src="../medias/images/ok.png" border="0" width="16" height="16" alt="" /></a>
			 {% else %}
			 <a href="/users/{{ x.id }}/chgstate/"><img src="../medias/images/lock.png" border="0" width="16" height="16" alt="" /></a>
			 {% endif %}
		</td>
		<td> {{ x.get_profile.get_user_type_display }} &nbsp;</td>
		<td> {{ x.date_joined|date:"Y年 m月d日 H:i:s" }}&nbsp;</td>
		<td> {{ x.last_login|date:"Y年 m月d日 H:i:s" }}&nbsp;</td>
		<td>
		<a href="#"><img src="../medias/images/del.png" width="16" height="16" border="0" alt="删除该用户" onclick="javascript:if (window.confirm('确认删除此用户?\n\n该用户被删除后有可能造成不可恢复的错误')){location.href='/users/{{ x.id }}/del/'}"></a>&nbsp;&nbsp;
		<a href="#"><img src="../medias/images/P.png" width="16" height="16" border="0" alt="修改用户密码" onclick="javascript:window.open('/users/{{ x.id }}/chgpass/', '_blank', 'width=420,height=250,menubar=no,toolbar=no,location=no,status=no,scrollbars=no,resizable=no')"></a>&nbsp;
		<a href="#"><img src="../medias/images/I.png" width="16" height="16" border="0" alt="查看用户信息" onclick="javascript:window.open('/accounts/{{ x.id }}/view/', '_blank', 'width=620,height=350,menubar=no,toolbar=no,location=no,status=no,scrollbars=no,resizable=no')"></a>
		</td>
	</tr>
	{% endfor %}
</table>
		</form>

					{% if is_paginated %}
                    {% ifequal current_page 1 %}
                    {% else %} <a href="?page=1"><img src="../medias/images/first.png" border="0" width="16" height="16" alt="转到第一页" /></a>
                    {% endifequal %}
                    {% if has_previous %} <a href="?page={{ previous }}"><img src="../medias/images/previous.png" border="0" width="16" height="16" alt="上一页" /></a>
                    {% else %} <img src="../medias/images/previous.png" width="16" height="16" border="0" alt="上一页" />
                    {% endif %}
                    {% for p in page_numbers %}
                        <a href="?page={{ p }}">{{ p }}</a>
                    {% endfor %}
                    {% if has_next %}<a href="?page={{ next }}"><img src="../medias/images/next.png" border="0" width="16" height="16" alt="下一页" /></a>
                    {% else %}<img src="../medias/images/next.png" border="0" width="16" height="16" alt="下一页" />
                    {% endif %}
                    {% ifequal current_page pages %}<img src="../medias/images/last.png" border="0" width="16" height="16" alt="转到最后一页" />
                    {% else %} <a href="?page={{ pages }}"><img src="../medias/images/last.png" border="0" width="16" height="16" alt="转到最后一页" /></a>
                    {% endifequal %}
                    &nbsp;&nbsp;
                    当前页：{{ page }}/{{ pages }}
                    &nbsp;&nbsp;
					{% endif %}              
					共[&nbsp;{{ hits }}&nbsp;]个用户
		</div>
	</div>
<!-- 	<div id="sidebar-wrapper">
		
			<div id="sidebar">
			
			</div>
		
	</div> -->
</div>
{% include "footer.html" %}
